
import ajax from '../axios';
import request from '../utils/request';
export const fetchData = query => {
    return request({
        url: './table.json',
        method: 'get',
        params: query
    });
}
//用户模块
export const userApi = {
    //登录
    userLogin: (params) => {
        return ajax.post('/login/loginByAccount', params)
    },
    //增加员工
    addUser:(params)=>{
        return ajax.postForm('/gy/user/addGyUser',params)
    },
    // // 删除用户
    // delUser: (id) => {
    //     return ajax.postForm('/gy/user/deleteGyUserById', { userId: id })
    // },
    //操作修改员工状态
    delUser: (params) => {
        return ajax.get('/gy/user/updateGyuserById', params)
    },
    //查询用户列表
    getUserList: (params) => {
        return ajax.get('/gy/user/queryAll', params)
    },

}
// 企业模块
export const companyApi = {
    // 增加
    addCompany:(params) =>{
        return ajax.postForm('/company/addCompany',params)
    },
    // 查询
    getCompanyList:(params) =>{
        return ajax.postForm('/company/queryAll',params)
    },
    // 删除
    delCompany:(id)=>{
        return ajax.postForm('/company/deleteCompany', { id: id })
    }
}
// 用户派遣模块
export const dispatchApi = {
    // 新增派遣
    addDispatch:(params) =>{
        return ajax.post('/userCompanyRes/add',params)
    },
    //获取跟进人列表
    getFolloUserList:(params)=>{
        return ajax.get('/login/queryAll',params)
    },
    // 查询
    getDispatchList:(params) =>{
        return ajax.post('/userCompanyRes/queryAll',params)
    },
    // 删除
    delDispatch:(params)=>{
        return ajax.post('/userCompanyRes/delete',params)
    }
}
// 工时模块
export const wordTimeApi = {
        // 新增派遣
        addWordTime:(params) =>{
            return ajax.post('/gy/workTime/add',params)
        },
        // 查询
        getWorkTimeList:(params)=>{
            return ajax.post('/gy/workTime/queryPage',params)
        },
        // 删除
        delWorkTime:(params)=>{
            return ajax.get('/gy/workTime/delete',params)
        },
        //导入，
        uploadFile:(params)=>{
            return ajax.postFile('/gy/workTime/upload',params)
        }
}
// 权限模板
export const permissionApi = {
    getMenuTree: (params) => {
        return ajax.get('/api/permissions/selectMenuTree.do', params)
    }
}

